window.onload=function () {
    var url = '/log/index';
    var config = {
        elem: '#log'
        ,url:url
        ,cols: [[
            {field:'log_id', width:80, title: 'id', sort: true}
            ,{field:'admin_name', width:150, title: '管理员'}
            ,{field:'operation_ip', width:150, title: 'ip'}
            ,{field:'log_time', width:200, title: '操作时间', templet:function (item) {
                    return timestampToTime(parseInt(item.log_time));
                }}
            ,{field:'log_content', title: '操作内容', minWidth: 150}

        ]]
        ,page: true
    };
    layui.use(['form','layer','jquery','table','laydate'], function(){
        var table = layui.table,
            form = layui.form,
            layer = layui.layer,
            laydate=layui.laydate;
        $ = layui.jquery;

        table.render(config);

        laydate.render({
            elem:'#start_time'
        });
        laydate.render({
            elem: '#end_time'
        });
        //搜索
        form.on("submit(serch-form)",function(data){
            var query = $("#serch-form").serialize();
            config.url = '/log/index?'+ query;
            table.render(config);
            return false;

        });
    });
};